<?php
$flashMessages = Yii::app()->user->getFlashes();
if ($flashMessages) {
    foreach($flashMessages as $key => $message) {
        echo '<div class="alert alert-' . $key . ' fade in"><button type="button" class="close" data-dismiss="alert">×</button>' . $message . "</div>\n";
    }
}
?>
<section class="add-record">
    <?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
        'id'=>'horizontalForm',
        'type'=>'horizontal',
    ));?>

    <fieldset>
        <legend>
            <?php echo Yii::t('app', 'Update status') ?>
            <a class="btn-back pull-right" href="<?php echo $this->createUrl('user/taskdetail', array('id'=>$model->id_task))?>">← <?php echo Yii::t('app', 'Back to list') ?></a>
        </legend>
        <div class="control-group ">
            <label class="control-label">
                <?php echo Yii::t('app', 'Step analyst') ?>
            </label>
            <div class="controls">
                <label>
                    <?php echo $model->step_analyst ?>
                </label>
            </div>
        </div>

        <?php if($model->status==Constant::STATUS_CLOSE): ?>
            <div class="control-group ">
                <label class="control-label">
                    <?php echo Yii::t('app', 'Status') ?>
                </label>
                <div class="controls">
                    <?php echo Constant::getStatus($model->status) ?>
                    <?php echo $form->hiddenField($model, 'status') ?>
                </div>
            </div>
        <?php else: ?>
            <?php echo $form->dropDownListRow($model, 'status', Constant::getStatusUser())?>
        <?php endif ?>

        <?php echo $form->textAreaRow($model, 'note', array('rows' => 8, 'class' => 'span5')); ?>

    </fieldset>
    <div class="form-actions">
        <?php
        $this->widget('bootstrap.widgets.TbButton', array(
            'buttonType' => 'submit',
            'type' => 'primary',
            'label' => Yii::t('app', 'Submit'),
            'icon' => 'plus-sign white'
        ));
        ?>
    </div>
    <?php $this->endWidget();?>
</section>